package org.zasadnyy.redlions.players.shared.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class TournamentItem implements Serializable {

	private static final long serialVersionUID = 7155179375574687396L;

	public static final String ID = "id";
	public static final String TITLE = "title";
	public static final String URL = "url";
	public static final String TIME = "time";
	public static final String PLAYERS = "players";

	private String id;
	private String title;
	private String url;
	private Date time;
	private List<String> playerIds = new ArrayList<String>();

	public TournamentItem() {
	}

	public TournamentItem(String title, String url, Date time,
			List<String> playerIds) {
		super();
		this.title = title;
		this.url = url;
		this.time = time;
		this.setPlayerIds(playerIds);
	}

	public TournamentItem(String id, String title, String url, Date time,
			List<String> playerIds) {
		super();
		this.id = id;
		this.title = title;
		this.url = url;
		this.time = time;
		this.setPlayerIds(playerIds);
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public void setPlayerIds(List<String> playerIds) {
		this.playerIds = playerIds;
	}

	public List<String> getPlayerIds() {
		return playerIds;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Tournament [id=").append(id).append(", title=")
				.append(title).append(", url=").append(url).append(", time=")
				.append(time).append("]");
		return builder.toString();
	}
}
